package CommentRating::CMS;
use strict;
use warnings;
use MT;
use MT::Comment;

sub cb_template_param_edit_comment {
    my ($cb, $app, $param, $tmpl) = @_;
    return unless UNIVERSAL::isa($tmpl, 'MT::Template');
    
    my $pointer_field = $tmpl->getElementById('ip');
    my $innerHTML = '<input name="url" id="url" value="<mt:var name="rating" escape="html">" class="width90" />';
    my $label = '<__trans_section component="commentrating"><__trans phrase="Rating"></__trans_section>';
    my $hint = '<__trans_section component="commentrating"><__trans phrase="It is the value that evaluated a entry with five phases."></__trans_section>';
    my $nodeset = $tmpl->createElement('app:setting', { id => 'rating', label => $label, hint => $hint, show_hint => 1 });
    $nodeset->innerHTML($innerHTML);
    $tmpl->insertAfter($nodeset, $pointer_field);
}

sub cb_template_param_edit_comment {
    my ($cb, $app, $param, $tmpl) = @_;
    return unless UNIVERSAL::isa($tmpl, 'MT::Template');
    
    my $pointer_field = $tmpl->getElementById('ip');
    my $innerHTML = '<input name="url" id="url" value="<mt:var name="rating" escape="html">" class="width90" />';
    my $label = '<__trans_section component="commentrating"><__trans phrase="Rating"></__trans_section>';
    my $hint = '<__trans_section component="commentrating"><__trans phrase="It is the value that evaluated a entry with five phases."></__trans_section>';
    my $nodeset = $tmpl->createElement('app:setting', { id => 'rating', label => $label, hint => $hint, show_hint => 1 });
    $nodeset->innerHTML($innerHTML);
    $tmpl->insertAfter($nodeset, $pointer_field);
}

1;